package com.wxzz.elearing.course.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.wxzz.elearing.course.entity.CurriculumSectionTopicAnswer;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface CurriculumSectionTopicAnswerMapper extends BaseMapper<CurriculumSectionTopicAnswer> {

    @Select("SELECT * FROM `curriculum_section_topic_answer` WHERE curriculum_section_topic_id = #{curriculumSectionTopicId} AND deleted = 0")
    List<CurriculumSectionTopicAnswer> listCurriculumSectionTopicId(@Param("curriculumSectionTopicId")Long curriculumSectionTopicId);
//逻辑删除
//    @Update("UPDATE curriculum_section_topic_answer SET deleted = 1 WHERE curriculum_section_topic_id = #{curriculumSectionTopicId}")
//    Integer deleteCurriculumSectionTopicAnswerByCurriculumSectionTopicId(Long curriculumSectionTopicId);

    @Delete("DELETE FROM curriculum_section_topic_answer WHERE curriculum_section_topic_id = #{curriculumSectionTopicId}")
    Integer deleteCurriculumSectionTopicAnswerByCurriculumSectionTopicId(Long curriculumSectionTopicId);
}
